package com.jt.www.enums.issue;

/**
 * 保单状态
 */
public enum PolicyStatusEnum {
    PS_00("01", "已退保"),
    PS_01("02", "已失效"),
    PS_02("00", "有效"),
    PS_99("99", "其他");

    private String code;
    private String desc;

    PolicyStatusEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static PolicyStatusEnum getEnumByCode(String code) {
        for (PolicyStatusEnum statusEnum : PolicyStatusEnum.values()) {
            if (statusEnum.code.equals(code)) {
                return statusEnum;
            }
        }
        return PS_99;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
